package jrobutt;

import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;

public class GameApplet extends JApplet implements GameoverListener
{
    public JRobuttComponent child;
    
    public void init ()
    {
        child = new JRobuttComponent();
        child.setSize(this.getSize());
        this.add(child, BorderLayout.CENTER);
        child.init(this.getSize());
        child.setGameoverListener(this);
    }
    public void stop ()
    {
        child.stop();
    }
    
    public void gameIsOver ()
    {
        Graphics2D g = child.offscreen;
        g.setColor(new Color(0, 0, 0, 128));
        g.fillRect(0, 0, getWidth(), getHeight());
        child.repaint();
    }
}
